﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using CoreEx.Common.Ioc;
using LinFu.IoC.Configuration;
using LinFu.IoC.Interfaces;
using LinFu.IoC;

namespace CoreEx.Database.Client.Implementation
{
    [PostProcessor]
    public class CommandPostProcessor : PostProcessorBase<IDbCommand>
    {
        public override void Process(IServiceRequestResult result)
        {
            ((IDbCommand) result.ActualResult).Connection = 
                result.Container.GetService<IDbConnection>(result.ServiceName);                            
        }
    }
}